package com.gwd.task.model;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.gwd.task.entity.CodeSubmitRecordEntity;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zhiyongming
 * @date 2020/12/22 9:43
 */
@Data
@NoArgsConstructor
public class CodeSubmitRecordDTO {

    private String[] codeRepository;
    private String submitUserName;
    private String mergerUserName;
    private String projectName;
    private String describe;
    private String lv1ModuleName;
    private String lv2ModuleName;
    //仓库id
    private Long repId;
    private Long csrId;
    // 类型 0:任务、1：生产、2：测试
    private Integer type;
    // 状态 0：待合并、1：已合并
    private Integer status;
    // 仓库位置 SIT|UAT|PP|PI
    private String repository;
    private Long projectId;
    private Long lv1ModuleId;
    private Long lv2ModuleId;
    private String code;
    private Long relateId;
    private Long taskId;
    private String submitTime;
    private Long submitUser;
    private String mergerTime;
    private Long mergerUser;

    public CodeSubmitRecordDTO(CodeSubmitRecordEntity entity) {
        BeanUtil.copyProperties(entity,this, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(false));
        this.repId = entity.getRepId();
    }
}
